import { defineStore } from 'pinia';

export const useAppStore = defineStore('app', {
    state: () => {
        return {
            auth: {},
            account: {},
            cache: {
                tabbarIndex: '0'
            },
        };
    },
    // 也可以这样定义
    // state: () => ({ count: 0 })
    actions: {
        updateCache(state, payload) {
            this.cache = {
                ...this.state.cache,
                ...payload
            }
        },
    },
});